<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateusersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('uid')->comment('用户id');
            $table->char('uname',20)->comment('用户姓名');
            $table->char('upwd',255)->comment('用户密码');
            $table->enum('sex',['w','m','x'])->default('w')->comment('用户性别');
            $table->string('tel',20)->default('unknow')->comment('用户电话');
            $table->string('uface',100)->default('/uploads/avatar/default.jpeg')->comment('用户头像');
            $table->string('addr',100)->default('unknow')->comment('用户地址');
            $table->unsignedInteger('auth')->default('0')->comment('用户权限');
            $table->string('email',30)->default('unknow')->comment('用户邮箱');
            $table->string('regtime')->comment('用户创建时间');
       });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('users');
    }
}
